/*
 * Copyright (C) 2013 Shanghai Paibo soft Co., Ltd
 *
 * All copyrights reserved by dalinggong.com
 * Any copying, transferring or any other usage is prohibited.
 * Or else, Shanghai Paibo possesses the right to require legal 
 * responsibilities from the violator.
 * All third-party contributions are distributed under license by
 * dalinggong soft Co., Ltd.
 */
package com.dlg.commons.enums;



/**验证码校验结果
 * @author jiangchangcheng  2017年3月31日 下午3:08:16
 * @since JDK 1.7	
 */
public enum VerifyCodeEnum {
	TIME_OUT(0, "验证码超时"), SUCCESS(1, "验证码校验成功"), FAIL(2, "验证码校验失败"),
	BLACK_LIST(3, "已加入黑名单"),VALIDATE_FAIL(4, "缺少参数 phone verifyCode source");
	
	
	VerifyCodeEnum(int code, String value){
		this.code = code;
		this.value = value;
	}
	private int code;
	
	private String value;
	
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	
	public static VerifyCodeEnum getByCode(int code) {
		VerifyCodeEnum[] enums = VerifyCodeEnum.values();
		for (VerifyCodeEnum tempEnum : enums) {
			if (tempEnum.getCode() == code) {
				return tempEnum;
			}
		}
		return null;
	}
	
}
